<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head th:replace="common/admin-header::header">
    <title>测试用例集</title>
</head>

<body class="app sidebar-mini rtl">
<div th:replace="common/admin-sadbar::sadbar"></div>

<!-- add Modal -->
<div th:replace="common/modal/testsuit-modal::testsuit_add_modal"></div>
<div th:replace="common/modal/testsuit-modal::testsuit_update_modal"></div>
<div th:replace="common/modal/testsuit-modal::testsuit_link_modal"></div>

<main class="app-content">
    <div class="app-title">
        <div>
            <h1><i class="fa fa-lg fa-th-list"></i> 测试用例集</h1>
            <p>测试用例集列表</p>
        </div>
        <ul class="app-breadcrumb breadcrumb">
            <li class="breadcrumb-item"><i class="fa fa-home fa-lg"></i></li>
            <li class="breadcrumb-item"><a href="#">测试用例集</a></li>
        </ul>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="tile">
                <div class="tile-body">
                    <div class="offset-md-10">
                        <button class="btn btn-primary" onclick="setProject('belongProject_a')" data-toggle="modal"
                                data-target="#testsuit_add_modal"><i class="fa fa-plus" aria-hidden="true"></i>新增测试用例集
                        </button>
                    </div>

                    <hr>
                    <table class="table table-hover table-hover" style="white-space: nowrap" id="sampleTable">
                        <thead>
                        <tr>
                            <th th:class="text-center">编号</th>
                            <th th:class="text-center">名称</th>
                            <th th:class="text-center">所属项目</th>
                            <th th:class="text-center">创建时间</th>
                            <th th:class="text-center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="testsuit:${testsuits}">
                            <td th:text="${testsuit.getTestSuitId()}" th:class="text-center">id</td>
                            <td th:text="${testsuit.getSuitName()}" th:class="text-center">name</td>
                            <td th:text="${testsuit.getProject().getProjectName()}" th:class="text-center">belong</td>
                            <!--todo 日期时间格式化-->
                            <td th:text="${testsuit.getCreateTime()}" th:class="text-center">time</td>
                            <td th:class="text-center">

                                <button class="btn btn-sm btn-primary"
                                        th:onclick="linkTestCaseShow([[${testsuit.getTestSuitId()}]])"
                                        data-toggle="modal" data-target="#testsuit_link_modal">
                                    <i class="fa fa-plus" aria-hidden="true"></i>关联用例
                                </button>
                                <button class="btn btn-sm btn-success"
                                        th:onclick="runTestSuit([[${testsuit.getTestSuitId()}]])">
                                    <i class="fa fa-play" aria-hidden="true"></i>运行
                                </button>
                                <button class="btn btn-sm btn-info"
                                        th:onclick="activeCurrentProjectOption([[${testsuit.getTestSuitId()}]])"
                                        data-toggle="modal" data-target="#testsuit_update_modal"><i class="fa fa-edit"
                                                                                                    aria-hidden="true"></i>修改
                                </button>
                                <button class="btn btn-sm btn-danger"
                                        th:onclick="deleteTestSuit([[${testsuit.getTestSuitId()}]])"><i
                                        class="fa fa-remove"
                                        aria-hidden="true"></i>删除
                                </button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</main>

<div th:include="common/script::script"></div>
<script th:src="@{/static/flytest-js/util.js}"></script>
<script th:src="@{/static/flytest-js/testsuit.js}"></script>
<script th:src="@{/static/valires/js/plugins/fakeLoader.js}"></script>
<script type="text/javascript">
    drawDataTable("#sampleTable");
</script>
</body>
</html>